<template>
  <div class="MyChat">
    <div class="my_user">
      <div class="time">{{ time }}</div>
      <div class="name">{{ name }}</div>
      <div class="other_main">
        <div class="other_message" v-html="con">
        </div>
        <div class="triangle_right"></div>
        <div class="avatar_warp">
          <el-avatar :size="50" shape="circle" :src="avatar" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "service",
  props: {
    name: {
      type: String,
      default: "",
    },
    time: {
      type: String,
      default: "",
    },
    avatar: {
      type: String,
      default: "",
    },
    con: {
      type: String,
      default: "",
    },
  },
};
</script>

<style scoped>
.time {
  text-align: center;
  color: #9a9a9a;
  padding-bottom: 2px;
}
.name{
  text-align: right;
}
/* 我的信息 */
.my_user {
  padding-bottom: 30px;
}

.other_main {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.other_message {
  padding: 10px 15px;
  border-radius: 20px;
  color: #000;
  line-height: 1.5;
  /* 调整行高 */
  font-size: 14px;
  background-color: #5aad6573;
  word-wrap: break-word;
  word-break: break-all;
  overflow: hidden;
}

.triangle_right {
  width: 0;  
  height: 0;  
  border-top: 10px solid transparent; /* 三角形顶部 */  
  border-bottom: 10px solid transparent; /* 三角形底部 */  
  border-left: 15px solid #ededed; /* 三角形左侧，即指向右边的部分 */  
  margin-right: 10px; /* 三角形与文本之间的间距 */  
}
</style>